package com.liuyk.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;

/**
 * Created by Administrator on 2015/9/9.
 * <p>
 * 模板方法设计模式
 */
public abstract class BaseBroadcastReceiver extends BroadcastReceiver {

    public BaseBroadcastReceiver() {
    }

    public BaseBroadcastReceiver(Context context) {
        final IntentFilter intentFilter = getIntentFilter();
        //使用LocalBroadcastManager注册广播
//        LocalBroadcastManager.getInstance(context).registerReceiver(this,intentFilter);
    }

    public void unRegisterSelf(Context context) {
//        LocalBroadcastManager.getInstance(context).unregisterReceiver(this);
    }

    protected abstract IntentFilter getIntentFilter();

}
